﻿

#region Using Statements

// System References
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Threading;

// XNA References
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

// Internal References
using Freeform.Framework;

#endregion



namespace Freeform.Framework.Graphics
{
    /// <summary>
    /// Actors are used to graphically represent a body through a viewport.
    /// </summary>
    public abstract class Actor
    {

        #region Members

        /// <summary>
        /// Gets the entity that this actor represents.
        /// </summary>
        public virtual Entity Entity { get; private set; }


        /// <summary>
        /// Gets or sets the colour overlay of the actor.
        /// </summary>
        public virtual Color ColourOverlay { get; set; }


        /// <summary>
        /// Gets or sets the depth of the actor. (0 - front of viewport, 1 - back of viewport.)
        /// </summary>
        public virtual Single Depth { get; set; }


        /// <summary>
        /// Gets or sets whether this actor is currently visible.
        /// </summary>
        public virtual Boolean IsVisible { get; set; }

        #endregion


        #region Init

        /// <summary>
        /// Creates a new Actor.
        /// </summary>
        /// <param name="entity">The entity that this actor will represent.</param>
        public Actor(Entity entity) 
        {
            Entity = entity;
            ColourOverlay = Color.White;
            IsVisible = true;
            Depth = 0.5f;
            Entity.Actor = this;
        }

        #endregion
        

        #region Draw

        /// <summary>
        /// Draws the entity onto the viewport.
        /// </summary>
        /// <param name="spatial">The spatial properties of the body.</param>
        /// <param name="viewport">The viewport onto which the entity is being rendered.</param>
        /// <param name="time">Provides a snapshot of timing values.</param>
        public virtual void Draw(Viewport2D viewport, GameTime time) { }

        #endregion

    }
}
